#include <iostream>
using namespace std;
int mystrlen(char *str, int n)
{
	int r;
	if (n == 0)
		return 0;
	if (n == 1)
		if (*str == '\0')
			return 1;
		else
			return 0;
	int k = 0;
	r = mystrlen(str, n / 2);
	if (r > 0)
		return r;
	else
		return (n / 2 + mystrlen(str + n / 2 + 1, (n + 1) / 2));

}

int main2()
{
	char str[] = { 'a','d','f','g','g','u','g','g','g','u','g','g','g','u','g','r','\0','d','f','g','g' };
	//cout << sizeof(str) << endl;
	int k;
	string s = str;
	cout << s.size() << endl;
	k = mystrlen(str, 20);
	cout << k << endl;
	//system("pause");
	return 0;

}
